<?php

namespace Common\Model;
use think\Model;

class UserTuanDetailModel extends BaseModel{

	//追加属性
    public $append = [
        'add_time_text',
        'status_text',
        'base_info',
        'dept_info',
	];

    public function getBaseInfoAttr($value, $data){
        $name = '';
		$model = M('user_tuan');
		$wdata['id'] = $data['tid'];
		$vo = $model->where($wdata)->find();
		return $vo;
    }

    public function getDeptInfoAttr($value, $data){
        $name = '';
		$model = M('user_tuan_dept');
		$wdata['id'] = $data['did'];
		$vo = $model->where($wdata)->find();
		return $vo;
    }

    //搜索
    function _before_search(){
        $map = [];
        $map['is_delete'] = 0;
        return $map;
    }


}